SOAP action error from AXIS - c#

I'm consuming a Java based Web Service with C# .NET app.
I'm sending a SOAP message in XML format.
But I'm receiving this error message:
ns1:Client.NoSOAPAction no SOAPAction header

You need to look at the WSDL for your service.
The SOAPAction is effectivly the URL you are sending the soap envelope to, so whatever software you are using should set this up in the http headers.

Related

Call to Web Service with ESB Routing Itinerary Service contains no content

I have an Itinerary that is called from a WCF Web Service (WCFService) through BizTalk. The first thing it does is a transformation, using Maps in WCFService. It then routes the response from the mapping to a Rest Service. I created WS-WebHttp adapter to be used with ESB.
The issue is that when it posts to the web service using HttpRequestMessage object, the message does not contain any content. As a test I also routed the transformation to passthough send port as a file and the transformation was correct.
My Itinerary
Here are the settings for the routing service
Routing Service Settings
The content-type is application/json.
I tested it using SOAPUI and it returned the content of the data going in.
Here is the Pipeline on the dynamic send port (request/response)
SendPipelineRequest
I believe I read that an ItinerarySelector is not used in the pipeline, because all the information is handled by the ItineraryCache.
I not sure where the issue is. I assume that the content from the transformation will be in the message passed on by the itinerary. Is there a way I can check this with itinerary before calling the service?
I appreciate the help.
UPDATE: No Content. I was doing a transformation through an itinerary service, instead of the pipeline. once I removed the transformation from the itinerary, and added the map to the incoming receive port, the Rest service receive the content, transformed.

JSON Decoder in custom pipeline is not working

I am using BizTalk+ESB. I send a request to a REST service. Using this pipeline.
Which uses the JSONEncoder. The rest service posts a message in the event log, letting me know the process was completed. The issue is, on the response, I get this error:
"The content type application/json; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)."*
This is the response pipeline:
It acts as if the JSONDecoder is not processing the response message.
The request is made using ESB Itinerary, and a WCF Web Service in BizTalk.
Any suggestions?
UPDATE - The call to the Rest service is in an Itinerary Service. WCF_WebHttp was not in the list of selections. Selected WCF-BasicHttp.
Now I receive the error: "There was a failure executing the response(send) pipeline: "PTwoMapPipeline.Part2RetMapPipeline, PTwoMapPipeline, Version=1.0.1.3, Culture=neutral, PublicKeyToken=7de7b3b357ccad5e" Source: "XML assembler" Receive Port: "WcfReceivePort_WCFInitiator/Service1" URI: "/WCFInitiator/Service1.svc" Reason: The document type "http://schemas.xmlsoap.org/soap/envelope/#Envelope" does not match any of the given schemas."
on the return Pipeline in my receive location. (Two way). Does this mean I need to add an Envelope schema. The Message is set in Receive location to use the body.
You need to use the WCF-WebHttp Adapter for a RESTful service. See WCF-WebHttp Adapter (Microsof.com)
Microsoft BizTalk Server uses the WCF-WebHttp adapter to send messages to RESTful services. The WCF-WebHttp send adapter sends HTTP messages to a service from a BizTalk message. The receive location receives messages from a RESTful service. For GET and DELETE request, the adapter does not use any payload. For POST and PUT request, the adapter uses the BizTalk message body part to the HTTP content/payload.
The WCF-WSHttp is expecting a SOAP envelope and XML see What Is the WCF-WSHttp Adapter? (Microsof.com).
The WCF-WSHttp adapter provides full access to the SOAP security, reliability, and transaction feature

WCF in "service reference" client gives less information in exception message than "web reference" client

I should call a web service in my C# application.
When I add a service reference in Visual Studio to consume the service, in an exception situation I get this message:
An HTTP Content-Type header is required for SOAP messaging and none
was found.
But, when I add a web reference the message is more rich and easy to understand the problem. The final part of this message is a business error message generated by the service. I was provided an invalid authentication token parameter for that service so this error message is returned:
Client found response content type of '', but expected 'text/xml'.
The request failed with the error message:
--
WEB SERVICE ERROR : UNAUTHENTICATED_ACCESS
I was preferred to use "service reference" approach but now I am in doubt.
Is there a way to improve this kind of exceptions or to log raw response using "service reference"?
I think the first message is much clearer.
It's telling you exactly what the problem is, which is the HTTP Content-Type header is missing from the service response. While this header is not mandatory, the HTTP specs say you should use it (from here):
Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body.
Microsoft obviously built into their proxy generation tooling the assumption that this header will always be present.
And no, you should not use WebReference. It's from .net 1.1

Soap Envelope Receiver in WindowsFormApplication Using HTTP in C#

I am new to SOAP, can any one please tell me how can i receive Soap Envelope using HTTP,
I have done receiving in TCP, where url for receiver is like
soap.tcp://localhost/receiver
i want to receive in http
http://localhost/receiver
can an one please guide me, if there is a configuration in app.config file please explain,

Using c# web api with alternate content-type

I'm new to web api and I need to create a server for a client. I have no control over the client - can't change a thing.
The client sends in an html encapsulated json request in a POST body. However, the content-type can vary. What do I need to do to allow my ApiController to process different content-types?
Under the hood, Web Api supports Content Negotiation mechanism to automatically opt the correct formatter based on the header Content-Type in HTTP request.
By default content negotiation supports three formatters: json, xml and form-urlencoded data. If no formatter found, client will receives HTTP error 406 (Not Acceptable).
See more:
https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/content-negotiation
If you need to allow Web Api support another Content-Type, you can write your own custom formatter:
https://learn.microsoft.com/en-us/aspnet/web-api/overview/formats-and-model-binding/media-formatters

Categories