We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,619 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

HttpWebRequest SOAPAction url/command

Hi,

I have an issue, with not being able to set the the correct header

here is the operation from the WSDL:

- <wsdl:operation name="findRegistrationByID" parameterOrder="registrationID">
  <wsdl:input message="impl:findRegistrationByIDRequest" name="findRegistrationByIDRequest" /> 
  <wsdl:output message="impl:findRegistrationByIDResponse" name="findRegistrationByIDResponse" /> 
  </wsdl:operation>

This is also from WSDL:

- <wsdl:operation name="findRegistrationByID">
  <wsdlsoap:operation soapAction="urn://url/findRegistrationByID" /> 
- <wsdl:input name="findRegistrationByIDRequest">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn://url/" use="encoded" /> 
  </wsdl:input>
- <wsdl:output name="findRegistrationByIDResponse">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn://url/" use="encoded" /> 
  </wsdl:output>
  </wsdl:operation>

here is my code:
Case 1:

req.Headers.Add("SOAPAction:", "urn://url/findRegistrationByID");

Error: Invalid HTTP Header characters. Parameter name:name
Case 2:

req.Headers.Add("SOAPAction", "urn://url/findRegistrationByID");

Error: This property is not implemented by this class.
Case 3:

req.Headers.Add("SOAPAction");

Error: Specified value does not have a ':' separator. Parameter name: header
Case 4:

req.Headers.Add("SOAPAction:");

Error: This property is not implemented by this class.
Case 5:
Without header
Error: The remote server returned an error: (500) Internal Server Error.


I don't have access to the server logs, and the SOAP request is built correctly. Can you point me in the right direction?

2
Contributors
4
Replies
3 Hours
Discussion Span
1 Year Ago
Last Updated
5
Views
observ
Newbie Poster
23 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Using the regular Web Services construction is not an option?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

I want to go this road :)

observ
Newbie Poster
23 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Can you make another app that uses WS and just compare how it does the soap header?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

Sorry, i can't seem to be able to create the request using an Web Reference. This is why i am trying with this method.

observ
Newbie Poster
23 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.2915 seconds using 2.67MB