b403b Forbidden

Does anybody know what some of the causes would be to a ‘403 Forbidden’ response from a service with one input?

thx

Check the ACL for the package/service or user access right for the service.

John,
I have seen if receiving service is expecting one type of input but receiving something different then also WM throws ‘403 Forbidden’ error.

Thanks for the responses.
I’m trying to post some xml to http://localhost:5555/invoke/WmSamples/sample.mime.helpers:streamToString, and even though I set the ACLs to Anonymous I still get the 403 response. Is there documentation on on to use the samples in WM 6.1?

thx

Have you set the ACLs on the folders containing the service?

Mark,
Hi. Yes, I’ve set the ACLs on all the folders and parent folders to ANONYMOUS. I’ve tried posting an xml document and 0 bytes of data. I’m setting my post headers to be:
“user-agent”=“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)”;
“Content-Type”=“text/xml”;
“charset”=“UTF-8”.
Any hints as to what is wrong with my configuration? What is the easist WMSample to get started off with?

thx

How did you setup input? The service is look for a stream input. If you input a xml document, which is a string operation. The service could not take that as an input.

HTH,

Fan

Hi Fan Zhang,
Here is my .Net code:

Dim strURL As String = "[url]http://localhost:5555/invoke/WmSamples/sample.mime.helpers:streamToString"[/url] 
Console.WriteLine("START: " + strURL) 
Dim WC As New WebClient 
WC.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") 
WC.Headers.Add("Content-Type", "application/octet-stream") 
WC.Headers.Add("charset", "UTF-8") 
Dim PostData As String = New StreamReader("workorder1.xml").ReadToEnd 
Try 
  WC.UploadData(strURL, "POST", Encoding.UTF8.GetBytes(PostData)) 
Catch ex As Exception 
  Console.WriteLine(ex.Message) 
End Try 
Console.Read() 

thx
-jsh

John,

I think Fan is on the right track.

To prove that anonymous access is working via http:

  1. Create a new package named JohnHTTP
  2. Create a folder named JohnHTTP
  3. Create a flow service in the folder named foo.
  4. Add a string variable to the output signature named john
  5. Add a map step to the flow service and set john to holsinger
  6. Set the execute acl of the service to anonymous
  7. Set the execute acl of the JohnHTTP folder to anonymous
  8. Enter the following url into your browser:
    http://localhost:5555/invoke/JohnHTTP:foo

Once you have this working, the next step is to consider the
type of service input. As Fan suggests, when invoking a service
via HTTP, you want to be passing in a string arg.

Hi John,

I am not an expert in .Net. But based on the VB.net I think you post the data as bytes not stream. Please ask someone good at .Net about how to post data as stream. Another way to do is call service bytestoStream in wM, then send stream to the service.

HTH,

Fan

Hi John,

Further look at the service you tried to call, I was wondering what goal you tried to achieve using the service. The streamTostring service in the sampler is expecting a java.io.ByteArrayInputStream. The http post is expecting load the data as a java.io.InputStream. I think the inputs are different, you can not use the service with a java.io.InputStream. The service in the sample is used for mime stream to string conversion. If you want to convert a xml data via http to a string, you should look at samples in DSP process how to accept a string or bytes data and convert to string output in wM.

HTH,

Fan

Hi All,

I think you’ll have to use a combination of pub.xml.xmlStringToXMLNode and pub.xml.xmlNodeToDocument and go from there.

Regards,

QN