Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2008, 08:47 PM
Authorized User
 
Join Date: Jun 2008
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default targetnamespace in wsdl and soap body

I'm new to sending SOAP requests. I use XMLspy and SOAPUi to construct the SOAP request. I'm happy what each will give. But I would like to understand how the targetnamespace in the wsdl is used to construct the SOAP request.

Can I use the messagename instead of the targetnamespace?

*----- snip of the WSDL ------*
.
.
<xsd:schema targetNamespace="SOAP_Requests" elementFormDefault="qualified">
      <xsd:element name="Receive-SOAP-Request">
            <xsd:complexType>
                  <xsd:all>
                        <xsd:element name="mydata" type="xsd:anyType" minOccurs="1">
                              <xsd:annotation>
                                    <xsd:documentation>String formatted XML data</xsd:documentation>
                              </xsd:annotation>
                        </xsd:element>
                  </xsd:all>
            </xsd:complexType>
      </xsd:element>
.
.
</xsd:schema>
    <wsdl:message name="SOAP_Requests_Receive-SOAP-Request-Request">
        <wsdl:part name="parameters" element="ns2:Receive-SOAP-Request-Request"/>
    </wsdl:message>
.
.
    <wsdl:portType name="WorkflowPortType">
        <wsdl:operation name="SOAP_Requests_Receive-SOAP-Request">
            <wsdl:input message="tns:SOAP_Requests_Receive-SOAP-Request-Request"/>
            <wsdl:output message="tns:SOAP_Requests_Receive-SOAP-Request-Response"/>
        </wsdl:operation>
    </wsdl:portType>


*----- SOAP that works ------*

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:myops.com:bmp:wflow" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:soap="SOAP_Requests">
   <soapenv:Header>
.
   </soapenv:Header>
   <soapenv:Body>
      <soap:Receive-SOAP-Request-Request>
            <soap:mydata>
                 my data here
            </soap:mydata>
      </soap:Receive-SOAP-Request-Request>
   </soapenv:Body>
</soapenv:Envelope>


*----- This construct will also work ------*
*----- but why does "xmldata" not have a prefix? ---*

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
.
.
  <soapenv:Body>
        <Receive-SOAP-Request-Request xmlns="SOAP_Requests">
              <mydata>
                  my data here
              </mydata>
        </Receive-SOAP-Request-Request>
  </soapenv:Body>
.
.



*----- questionable SOAP call ------*

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
   <soapenv:Header>
.
.
   </soapenv:Header>
   <soapenv:Body>
      <SOAP_Requests_Receive-SOAP-Request-Request xmlns="urn:myops.com:bmp:wflow">
           <mydata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">
                my data here
           </mydata>
.
.
      </SOAP_Requests_Receive-SOAP-Request-Request>
   </soapenv:Body>
</soapenv:Envelope>






Similar Threads
Thread Thread Starter Forum Replies Last Post
wsdl.exe costaaa C# 1 August 6th, 2006 05:35 AM
SOAP WSDL and AJAX need a professional help NEO1976 Ajax 0 July 28th, 2006 04:45 AM
Response.Write output is of <body></body> yoord BOOK: Beginning ASP.NET 1.0 0 October 13th, 2004 07:06 AM
WSDL Reader: Loading of the WSDL file failed. Anil .NET Web Services 0 January 23rd, 2004 02:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.