I created a wsdl from a service that has an xml template. I can run the service from IE and get the results. I add the web reference to my .net project and try to create a new instance but it does not work.
code:
Dim myNewInstance as New MyProject.localhost.(?)
When I create web services from .net the ? is usually the class. Then I can call the methods → myNewInstance.getdata()
The wsdl does not seem to contain all the information to create an instance. Can anyone help?
I did run the wsdl.exe and created the .vb class. Yesterday I just tried to set a web reference and that was my problem. It looks like the webMethods service returns a System.Xml.XmlElement from the XML Template.
This is my code:
Dim wmWsdl As New elc_common_errorHandling_utilsService
Dim returnData As System.Xml.XmlElement
returnData = wmWsdl.getErrorInterface()
Dim reader As XmlNodeReader = New XmlNodeReader(returnData)
Dim ds As DataSet
ds.ReadXml(reader)
reader.Close()
DataGrid2.DataSource = ds
DataGrid2.DataBind()
The error is “The XML declaration is unexpected. Line 2, position 3.”
Are you using Soap-RPC or Soap-Msg (document/literal)? What are the input and output signatures of your service? Can you post the WSDL as an attachment?
BTW, I added the code highlighting to your last post using the [highlight=vb] tags.
I am using the protocol http-get via http. No input or output elements I just call a JDBC adapter that returns rows from a database. The service returns an xml stucture with the data from the pipeline created my the xml template. I can invoke the service from a browser and see the xml and the data.
I’m not saying you can’t get one of the others to work, but you should expect to have interoperability issues with other tool vendors.
Search the Web Services / Soap forum for “document / literal” for information on how to create the wrapper service you need to expose a given Flow or Java service as a document/literal web service.
I will try using SOAP-Msg. Thanks for the article. I created a test service to sum 2 numbers and return the total and used SOAP-RPC to create the webservice. I used the wsdl to create the proxy adding username and password but the service said access denied in webMethods admin console. I just changed the service to anonymous and it worked. The same method did not work for a service that returns an xml template vs. output string. The instance of the class.method in .net does not let me assign the web service return value (xml) scrolling over the instance it says “Expression does not contain a value”. Still trying!
By default, IS requires clients to authenticate (login) before they can invoke a service. This requires all web services consumers to at least use Basic Authentication to provide a set of credentials (username and password). When the request is coming in via HTTP, the credentials are passed in HTTP header variables (a standard part of the HTTP protocol).
Each programming language has its own set of methods for setting the values of HTTP header variables. I don’t recall the methods for VB .Net or C# off of the top of my head, but you need to use then to set the authentication type to “Basic” and then add the username and password to the credentials.
Perhaps one of our .Net developers can help or I’m sure you can find it in the docs. In the meantime, in Development only, you can set the ACL to anonymous as you have done to workaround this, just be sure to not promote this beyond your development environment.