Java Reference
In-Depth Information
I've also highlighted the <types> element in the WSDL. You'll notice the difference here
right away: the .NET-generated WSDL puts its types directly inline, without creating a separ-
ate external document the way that the Java EE 5 service does.
Also, check out the indication on the SOAP 1.1 binding to make sure that it conforms to the
Basic Profile 1.1. This was added to the WSDL using the WebServiceBinding attribute on
the service class itself, and by setting EmitConformanceClaims=true .
Also, the WSDLs generated by JAX-WS do not include any Sun- or Java-specific code. While
you can ignore it here, and the service does in fact comply with the BP, you can see that there
is a Microsoft namespace imported.
Here is a SOAP 1.1 message that represents a valid request for this service:
POST /WebSite1/Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://soacookbook.com/dotnet/HelloMsg"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloMsg xmlns="http://soacookbook.com/dotnet">
<name>string</name>
</HelloMsg>
</soap:Body>
</soap:Envelope>
If you just use the tester web page to check your service, the page will use the HTTP method
to invoke it. This method expects you to make an HTTP POST using the following content:
POST /WebSite1/Service.asmx/HelloMsg HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 9
name=Eben
The HTTP headers indicate the destination, and other items that allow you to invoke the ser-
vice without SOAP altogether, though the response will be a standard HTTP response, and not
a more structured XML document.
Here is a JSP that invokes the service with an HTTP POST:
Search WWH ::




Custom Search