cancel
Showing results for 
Search instead for 
Did you mean: 

Need help running B1WS

Former Member
0 Kudos
77

Hello,

I've downloaded the B1WS and follow all the configuration instruction. But after running the ASPNET_Sample and try to login to my SAP B1, i got this error

"Client found response content type of 'text/html', but expected 'text/xml'. The request failed with the error message: -- "

"Server Application Error

The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance. --.!"

I have check the DIServer log file, but its not helpful. Anybody can give me the idea of what went wrong??

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Hafiz,

Could you check B1WSHander under <<C:\Program Files\SAP\SAP Business One Web Services\B1WS\App_Code\B1WSHandler.cs>>?

Do you find the following content-type of response that should be consistent with Request?

Response.AppendHeader("Content-Type", Request.ContentType);

if not, please use the attached to replace it.

But the way, actually you can make a break point under

public void ProcessRequest(HttpContext context)

to check what is wrong there.

Did you download it from SDN by yourself?I think the one from SDN should work fine. Thanks.

Regards

-Yatsea

Former Member
0 Kudos

I've checked the B1WSHandler.cs, its the same with ur post. I never changed the code.

Do i have to make change to any code before i can use the sample??

I had try to make a new asp.net page and added the web reference from the B1WS, but still got the same error.. "Client found response content type of 'text/html', but expected 'text/xml'"

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Hafiz,

It works fine in my env.

In this case, you may need to use in B1HttpHanlder.cs

Response.AppendHeader("Content-Type", "text/xml");

instead of

Response.AppendHeader("Content-Type", Request.ContentType);

Any question, please let me know.Thanks

Kind Regards

-Yatsea

Former Member
0 Kudos

Hello Yatsea,

Still no luck regarding the error. I wonder if my IIS got problem, or maybe i got the incorrect setting.

In IIS, i create a virtual directory pointing to the ASPNET sample. And when i browse it, it cannot be displayed and it give out error 500.

before this i only run the sample using the VS2005 development environment. The sample site got no problem displaying in the development environment.

Is it my IIS??

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Hafiz,

Http 500 Inter server indicate something with IIS server. You can check it from MS support website

[http://support.microsoft.com/kb/311766|http://support.microsoft.com/kb/311766]

Or you may google for more info. Any way, B1WS sample works fine now. : ) Thanks.

Kind Regards

-Yatsea

Former Member
0 Kudos

Yatsea, what does this means??

Notes on the sample code

1. One very important point not to forget when using B1WS is to fill the MsgHeader class with the relevant information regarding the DI Server session ID you are connected to and the name of the service you want to access. Each service has a MsgHeaderValue property to be set with the MsgHeader class.

2. Per each object property with a type different of string an associated Boolean property with the same name but finishing with u201CSpecifiedu201D is automatically created by .NET environment. You are forced to set this property value to u201Ctrueu201D if you want the associated property to be correctly set in the DI Server SOAP message automatically formatted.

Former Member
0 Kudos

Hello Yatsea,

My B1WS sample is displaying correctly when run in VS2005 dev environment. But it still give out error "response text/html, expected text/xml" after clicking the login button. I think i would stick with DI Server.

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Hafiz,

Have you try to update B1HttpHanlder.cs as my last post.

In this case, you may need to update B1HttpHanlder.cs

<<C:\Program Files\SAP\SAP Business One Web Services\B1WS\App_Code\B1WSHandler.cs>>

Response.AppendHeader("Content-Type", "text/xml");

instead of

Response.AppendHeader("Content-Type", Request.ContentType);

Let me know, after that whether you can run the B1WS sample or not. Thanks.

<<C:\Program Files\SAP\SAP Business One Web Services\Samples\WindowsSample>>

Kind Regards

-Yatsea

Former Member
0 Kudos

Hello Yatsea.

Yes, i already try that one. And i try to run both of the sample, the ASPNET sample and windows sample. Both give out result error "response text/html, expected text/xml".

Nevermind, i'll proceed with DI Server then. I'll KIV this and try to run this later on a new machine.

Thanks for your help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hye Yatsea

I'll follow your advice and try to look into details of what went wrong.

by the way, as far as i'm concern, i downloaded the B1WS installer from the SDN.

Thanks..

Former Member
0 Kudos

Anyone??