ts84zs
asked on
Read Soap services in .net
I have to read data published on soap-services.
I have the WSDL of the soap service.
In order to request the data or to connect to that soap-service, first of all, I have to connect using userid/password.
Then I have to pass a request whose xml looks like this -
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cm="http://oracle.com/mysoapservices.xsd">
<soapenv:Header/>
<soapenv:Body>
<mysoapservices>
<request>
<assignmentId></assignment Id>
<needCompletionDetails>Y</ needComple tionDetail s>
<hostSystem>myhostsystem</ hostSystem >
</request>
</mysoapservices>
</soapenv:Body>
</soapenv:Envelope>
That request will send a response, which will also be xml-format...
I have to write that data to a database . I can do like whats mentioned in https://msdn.microsoft.com/en-us/library/bb628652.aspx but I have to access the data by passing that xml-request object and getting xml-response object...
How should i do it. I want to do it in .net
Thanks so much...
I have the WSDL of the soap service.
In order to request the data or to connect to that soap-service, first of all, I have to connect using userid/password.
Then I have to pass a request whose xml looks like this -
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cm="http://oracle.com/mysoapservices.xsd">
<soapenv:Header/>
<soapenv:Body>
<mysoapservices>
<request>
<assignmentId></assignment
<needCompletionDetails>Y</
<hostSystem>myhostsystem</
</request>
</mysoapservices>
</soapenv:Body>
</soapenv:Envelope>
That request will send a response, which will also be xml-format...
I have to write that data to a database . I can do like whats mentioned in https://msdn.microsoft.com/en-us/library/bb628652.aspx but I have to access the data by passing that xml-request object and getting xml-response object...
How should i do it. I want to do it in .net
Thanks so much...
ASKER
Is that the only way to access read soap services...
No, but that's the reason why SOAP service are built they way they are.
ASKER
Ok thanks so much... So that's the best way to do it ?
Yup.
ASKER
Ok thanks a lot
ASKER
i found this one another way to access SOAP - http://www.roelvanlisdonk.nl/?p=1893.. its like using HttpWebRequest class
What are pros & cons of both the methods? thanks so much....
What are pros & cons of both the methods? thanks so much....
It ignores the SOAP stack in VS... so you may do it like that. But you will have a much harder day finding bugs in your code.
ASKER
Thanks so much... Can you please send me more information like link that provides such tips for accessing soap services or books
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks so much
ASKER
My SOAP services are created using some oracle obiee server .. So I cannot use SOAPClient class...
Does it provide a WSDL?
ASKER
Yes
Then use this WSDL to add your service reference.
ASKER
ok... thanks so much....
Hi,
I would like to urge you on following ste5an's advice. Yes, you can call SOAP manually as that article describes, but why? It would be like reinventing the wheel, when the adding a Service Reference will do the hard job for you. After that you do not have to care about the XML, you will get actual .Net classes to fill in and use for your requests and responces.
Giannis
I would like to urge you on following ste5an's advice. Yes, you can call SOAP manually as that article describes, but why? It would be like reinventing the wheel, when the adding a Service Reference will do the hard job for you. After that you do not have to care about the XML, you will get actual .Net classes to fill in and use for your requests and responces.
Giannis
Obvious, that's how SOAP works.
When it is a SOAP Service: Then NO, you have not to do that. Cause adding the web service reference to your project will create all the necessary code behind, so that you can access those values by the generated classes,