DiscountASP.NET Forums                  

Go Back   DiscountASP.NET Forums > Site Programming, Development and Design > ASP.NET WebServices

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 03-29-2012, 07:57 AM   #1
deadtroll
 
Join Date: Mar 2012
Posts: 2
Webservice needed to conform to someone else predefined soap format

I need to create a webservice where the out put matches someone elses predefined soap message. It's an authentication web service, I just need help getting the response to match their examples. I can post their wsdl if needed but it's unformated and hard to read.

Their example response is supposed to look like this.
Code:
<AuthenticateResponse>
   <AuthenticateResult>true</AuthenticateResult>
   <ResultMetaData>
      <ResultCode>0</ResultCode>
      <ResultMessage>Message</ResultMessage>
      <ResultDescription>Description</ResultDescription>
   </ResultMetaData>
</AuthenticateResponse>
So I created two serializable classes Authorization, ResultData
Code:
<Serializable()> _
Public Class Authorization
    Property AuthenticateResult As Boolean
    Property ResultMetaData As ResultData
End Class
<Serializable()> _
Public Class ResultData
    Property ResultCode As Integer
    Property ResultMessage As String
    Property ResultDescription As String
End Class
and my webservice function returns type is Authorization. However the soap 1.1 return looks like this...which they say won't work for them...
Code:
    <AuthenticateResponse xmlns="http://mydomain.com/auth/">
      <AuthenticateResult>
        <AuthenticateResult>boolean</AuthenticateResult>
        <ResultMetaData>
          <ResultCode>int</ResultCode>
          <ResultMessage>string</ResultMessage>
          <ResultDescription>string</ResultDescription>
        </ResultMetaData>
      </AuthenticateResult>
    </AuthenticateResponse>
Anyone have any suggestions on how to make them closer?
deadtroll is offline  
Old 03-29-2012, 02:08 PM   #2
CrystalCMS
Joe
 
Join Date: Jan 2009
Posts: 549
So you have a wsdl and you need to create a web service that matches the contract defined in the wsdl? Is that what you're trying to do?

If so I wouldn't bother trying to hand crank classes to try and match the wsdl definition - the easy way is to use the .NET SDK wsdl.exe tool and let it do the hard work. Generally wsdl.exe is used to generate client proxy classes to hosted web services but it can also be used to create a web service from a wsdl file.

Note wsdl.exe creates legacy asmx .NET 2.0 quality code so if you want newer WCF code you can use the svcutil.exe tool to generate WCF service contracts.
CrystalCMS is offline  
Old 04-02-2012, 08:02 AM   #3
deadtroll
 
Join Date: Mar 2012
Posts: 2
Yes thats what I was saying. I'm running into the problem of an incorrectly formatted wsdl now... they only reference their wsdl is in their documentation so now I'm left trying to fix it. *eye roll* .... Thanks for the tip on svcutil as well I've not seen any reference to that up until now.
deadtroll is offline  
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:10 AM.


vBulletin ©Jelsoft Enterprises Ltd.