cancel
Showing results for 
Search instead for 
Did you mean: 

Proxy error when filled with special character &

Former Member
0 Kudos

Dear Experts,

I have generated a proxy and testing it with special characters ampersand & as shown below


Username&Rebecca&Password

and I am receiving the following error.

The field URL is created as a String in SAP PO system and its mirror technical type in ECC is STRING.

When tested from SPROXY , it shows error "The value is incompatible with type g."

Please help to solve which data type I can use in PO to avoid the error due to special characters.

Regards

Rebecca...

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor

Change Username&Rebecca&Password to Username&amp ;Rebecca&amp ;Password and try?

                             


If you want to handle then you have to go for java mapping and change "&" to " & " in PI.

Refer to below thread.

Former Member
0 Kudos

Dear Hareesh,

I assume my queries were just little to understand the whole scenario. I am working on a scenario to call the JAVA rest web services from SAP.

The purpose of this field in ECC proxy is to append the text User&Password&DeptId to the static url i.e.http://jave32:neduk:7097/IntegrationServlet?action=

present in the SAP PI mapping. So when SAP PI tries to connect rest services , the whole url will look like this

http://java32:neduk:7097/IntegrationServlet?action=User&Password&DeptId

The value of User, Password and Dept Id will be captured during runtime in ECC. That's why I am testing in ECC and got this error.

I am in the initial stage of design and if you feel that you can share your input, it's heartily welcomed.

Regards...

engswee
Active Contributor
0 Kudos

Hi Rebecca

The & character is a predefined entity reference in the XML syntax. Refer to the link below:-

XML Syntax

Therefore you cannot use it as-is within the content of an XML element tag. This will cause the whole XML to be invalid. To correctly represent the character & within an XML element tag, you need to replace it with & instead.

As Amit has mentioned, you are manually entering the XML data (which is invalid) when using the test proxy functionality.

Change the line to the below instead:-

<URL>Username&amp;Rebecca&amp;Password</URL>

Rgds

Eng Swee

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

It seems that u are manually entering this special character while making dummy proxy call and that's the reason you are facing this issue. As suggested above, just send the special character in correct format.

I believe in real scenario ur proxy code will handle this conversion so no need to do anything in PI.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hello Amit,

I am working on a scenario to call the JAVA rest web services from SAP.

The purpose of this field in ECC proxy is to append the text User&Password&DeptId

to the static url i.e.http://jave32:neduk:7097/IntegrationServlet?action=

present in the SAP PI mapping (using dynamic url). So when SAP PI tries to connect rest services , the whole url will look like this

http://java32:neduk:7097/IntegrationServlet?action=User&Password&DeptId

The character & is very much required to call the rest web service.

The value of User, Password and Dept Id will be captured during runtime in ECC. That's why I am testing in ECC and got this error.

The special character I have to handle in ECC if my assumption that the fully formed URL after appending the string captured in ECC will call the rest web services.


<< I believe in real scenario ur proxy code will handle this conversion so no need to do anything in PI>>

I am not sure whether during the proxy runtime in ECC , it will cause dump when handling the character & as it is doing  now.

As per your suggestion , I will try to append the amp with &  and then remove it in SAP PI avoid error in ECC.

Any suggestion to improve the design , its heartily appreciated..

Regards...