cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Marketplace Adapter - 500 Internal Server Error

mateen_popatia
Participant
0 Kudos

Hi,

My requirement is Marketplace -> PI 7.3 -> ECC in a B2B scenario. My customer is sending xCBL Orders from marketplace. For this I have configured Sender Marketplace adapter in PI (using HTTPS).

I have asked the customer to send data to the url https://<host>:<port>/MessagingSystem/receive/MPA/MML 

and have provided him with the logon data. 

But when the customer is trying to send the data, he is getting 500 - Internal Server Error response. Could you please let me know whats the issue? Its really urgent, so urgent help is appreciated.

But when I opened the URL on my browser I get following response:

<StatusInfo>

<StatusMessage>MessagingServlet is active.</StatusMessage>

<Version>Messaging System 7.1</Version>

<Usage>

http://[host]:[port]/MessagingSystem/receive/[connection]/[protocol]

</Usage>

<RequestURL>

https://[host]:[port]/MessagingSystem/receive/MPA/MML

</RequestURL>

<Connection>

<Name>MPA</Name>

<Status>started</Status>

<Listener>registered</Listener>

</Connection>

<Protocol>

<Name>MML</Name>

<Status>EventHandler registered</Status>

</Protocol>

</StatusInfo>

Thanks,

Regards,

Mateen.

Accepted Solutions (0)

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi Mateen,

500 is so called "internal server error": Something unexpected happend there. This can be related to wrong path or wrong content.

Best is if you test your service with an external tool (e.g. Microsoft Wfetch or Firefox Poster, a lot freeware tools are available). Then provide the customer exactly your example (url and message).

/Udo

mateen_popatia
Participant
0 Kudos

Hi Udo,

Thank for your response Mate. I did test using Firefox Poster but apparently Firefox Poster was able to post the message to PI successfully. Even the customer tested using from Firefox poster and the message reached PI and the customer for response 200. But when he did tested the same message from Marketplace he got 500 - internal server error. Any clues?

/Mateen.

udo_martens
Active Contributor
0 Kudos

Hi Mateen,

he used may be a wrong url or a wrong message. Or what ever. It is not you who is responsible to create a successful request. You are not working with Marketplace, how can you analyze what the customer did wrong? If the customer can reach your service with firefox poster then your job is done.

/Udo

mateen_popatia
Participant
0 Kudos

Hi Udo,

The customer is now able to send the message to PI. However now when the message reaches adapter engine it fails with error message "Inbound message creation failed for protocol handler MML. Reason: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.ClassCastException: class java.lang.String:null incompatible with class javax.mail.internet.MimeMultipart:library:mail_api_ri@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2548ccb8@alive"

The customer is sending the message with content type as application/x-www-form-urlencoded

For other content types its working but not for application/x-www-form-urlencoded and the customer is not ready to change it at his end.

/Mateen.

udo_martens
Active Contributor
0 Kudos

Hi Mateen,

you can build an adapter module to change the content type and put it before the standard processing. But i guess it is much easier for the other side to call the service with right content type. In addition it is the wrong philosophy: PI offers here a service (-> sender adapter). Applications which want to use the service, need to call it syntactically correct. It s not the service provider who has to adapt his services to the consumers.

/Udo

mateen_popatia
Participant
0 Kudos

Hi Udo,

The customer is not ready to change at their end. I have used standard adapter module but its not working.

Below is how the source data:

Date: Wed, 3 Apr 2013 22:41:49 -0500 (CDT)

Message-ID: <367957612.111331.1365046909604.JavaMail.wmuser@uhttpgw>

MIME-Version: 1.0

Content-Type: multipart/related;

          boundary="----=_Part_111330_938132498.1365046909603"

Content-ID: df247ab9-8c4f-4f2f-bc72-d550220ef282

x-Date-Sent: 03 Apr 2013  22:41:49 CDT

x-Document-Type: Order

x-Priority: 5

x-Correlation-Id: 5138201A390E08B0E10080000A48118E

x-Request-Annotation: normal

x-Request-Mode: peer-peer; ack=yes; delivery=express

x-Sender-Id: 8d3f508a-7a60-1000-aeec-0a0e06070001

x-Message-Format: Commerce One 1.0 N; owner="Commerce One"; version=1.0; date="June 1999"; variant=N

x-Recipient-Id: fc87278c-7a02-1000-9ebe-0a0e06070001

x-Message-Id: df247ab9-8c4f-4f2f-bc72-d550220ef282

------=_Part_111330_938132498.1365046909603

Content-Type: application/xml; owner=x-commerceone; version=1.0; type=Order;

    ns="urn:x-commerceone:document:com:commerceone:XCBL30:XCBL30.sox$1.0"; charset=UTF-8

Content-Transfer-Encoding: 7bit

Content-ID: df247ab9-8c4f-4f2f-bc72-d550220ef282

Content-Description: Document

Content-Disposition: inline

<?xml version="1.0"?>

<?soxtype urn:x-commerceone:document:com:commerceone:XCBL30:XCBL30.sox$1.0?>

<Order>

  <OrderHeader>

    <OrderNumber>

      <BuyerOrderNumber>4500969880</BuyerOrderNumber>

    </OrderNumber>

    <OrderIssueDate>20130307T12:00:00</OrderIssueDate>

    <OrderReferences>

      <AccountCode>

        <Reference>

          <RefNum>A703</RefNum>

        </Reference>

      </AccountCode>

      <ContractReferences>

        <ListOfContract>

          <Contract>

            <ContractID>

              <Identifier>

                <Agency>

                  <AgencyCoded>AssignedByBuyerOrBuyersAgent</AgencyCoded>

                </Agency>

                <Ident>5600014813</Ident>

              </Identifier>

            </ContractID>

          </Contract>

        </ListOfContract>

      </ContractReferences>

.........................

..........................

  </OrderSummary>

</Order>

------=_Part_111330_938132498.1365046909603

Content-Type: application/xml; owner=x-commerceone; version=1.0; type=catalog;

    ns="urn:x-commerceone:document:com:commerceone:xdk:xml:catalog.dtd$1.0"; charset=UTF-8

Content-Transfer-Encoding: 7bit

Content-ID: df247ab9-8c4f-4f2f-bc72-d550220ef282

Content-Description: Catalog

Content-Disposition: inline

<?xml version="1.0"?>

<!DOCTYPE catalog [

<!ELEMENT catalog ((map)*) >

<!ELEMENT map EMPTY >

<!ATTLIST map

  uri CDATA #REQUIRED

  to  CDATA #REQUIRED >]>

<catalog>

</catalog>

------=_Part_111330_938132498.1365046909603--

And here is the config i have added in module tab

localejbs/AF_Modules/MessageTransformBean   LocalEnterpriseBean    mtb

MarketPlaceAdapterBeanModule                        LocalEnterpriseBean   MarketplaceAdapterKey

MarketplaceAdapterKey        Timeout                              300000

mtb                                     Transfer.ContentEncoding     7bit

mtb                                     Transform.Class                   com.sap.aii.af.sdk.xi.adapter.Conversion

mtb                                     Transform.ContentDescription Catalog

mtb                                     Transform.ContentDisposition  inline

mtb                                      Transform.ContentType          application/xml; owner=x-commerceone; version=1.0; type=catalog; ns="urn:x-commerceone:document:com:commerceone:xdk:xml:catalog.dtd$1.0"; charset=UTF-8

0 Kudos

Hi Mateen,

Try ONLY following parameter for content type transformation for key 'mtb' :

mtb     Transform.ContentType      application/xml;charset=UTF-8

Regards, Venkat

mateen_popatia
Participant
0 Kudos

Hi Venkat,

I tried. It doesn't work

Kind Regards,

Mateen

0 Kudos

Hi Mateen,

I think you have to write a custom module to change the content types for multi-part messages.

Just compare the source that comes from your customer(application/x-www-form-urlencoded) with the working source that has normal content type. Then accordingly write a module to change it's all parts in multi-part source.

As Udo rightly said above, adapter should not change its behavior to cater to different content types.

Regards, Venkat