webmethod based on a xsd

Discussion in 'ASP .Net Web Services' started by Roger Moquin, Dec 6, 2005.

  1. Roger Moquin

    Roger Moquin Guest

    Hi,

    i have to build a webservice for a client of mine who sent me a xsd and a
    sample xml so i can build my stuff around his xml.

    i used xsd.exe to build a class from the xsd. That went fine.

    Now, when i create my web service and the webmethod that receives the class
    as a parameter, the webservice puts the webmethod name and parameter name in
    the xml tag it wants to receive.

    Am i doing it the right way ? what can i do ?

    Here is the exemple:

    this is what i get from the client

    <?xml version="1.0" encoding="UTF-8" ?>
    <PROCESS_PO_007
    xmlns="http://www.openapplications.org/003_process_po_007">
    <CNTROLAREA>
    <BSR>
    etc.....

    and this is how i created my web service


    <WebMethod()> _

    Public Function Submit(ByVal PO As PROCESS_PO_007) As String

    Return "GOT IT"

    End Function



    where PROCESS_PO_007 is the class that was created by xsd.exe

    now, here is what the webservice says it want's to receiver:

    <?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>
    <Submit xmlns="http://tempuri.org/AlcoaPI/PO">
    <PO xmlns="http://www.openapplications.org/003_process_po_007">
    <CNTROLAREA>
    <BSR>


    Please help !!!
    Roger Moquin, Dec 6, 2005
    #1
    1. Advertising

  2. Roger Moquin

    GCR Guest

    By getting the xsd from your customer you're in the position of developing
    your web service using the "contract first" pattern. You can find a very
    usefull information+tool under:
    http://www.thinktecture.com/Resources/Software/WSContractFirst/default.html



    "Roger Moquin" wrote:

    > Hi,
    >
    > i have to build a webservice for a client of mine who sent me a xsd and a
    > sample xml so i can build my stuff around his xml.
    >
    > i used xsd.exe to build a class from the xsd. That went fine.
    >
    > Now, when i create my web service and the webmethod that receives the class
    > as a parameter, the webservice puts the webmethod name and parameter name in
    > the xml tag it wants to receive.
    >
    > Am i doing it the right way ? what can i do ?
    >
    > Here is the exemple:
    >
    > this is what i get from the client
    >
    > <?xml version="1.0" encoding="UTF-8" ?>
    > <PROCESS_PO_007
    > xmlns="http://www.openapplications.org/003_process_po_007">
    > <CNTROLAREA>
    > <BSR>
    > etc.....
    >
    > and this is how i created my web service
    >
    >
    > <WebMethod()> _
    >
    > Public Function Submit(ByVal PO As PROCESS_PO_007) As String
    >
    > Return "GOT IT"
    >
    > End Function
    >
    >
    >
    > where PROCESS_PO_007 is the class that was created by xsd.exe
    >
    > now, here is what the webservice says it want's to receiver:
    >
    > <?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>
    > <Submit xmlns="http://tempuri.org/AlcoaPI/PO">
    > <PO xmlns="http://www.openapplications.org/003_process_po_007">
    > <CNTROLAREA>
    > <BSR>
    >
    >
    > Please help !!!
    >
    >
    >
    GCR, Dec 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,099
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    484
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    855
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    785
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Replies:
    1
    Views:
    526
    Henry S. Thompson
    Jun 30, 2004
Loading...

Share This Page