cancel
Showing results for 
Search instead for 
Did you mean: 

Help B1WS Add Sales Order

juandfranco
Explorer
0 Kudos

Buen día, estoy tratando de añadir un pedido desde b1ws y estoy teniendo el siguiente error pero mi código aparentemente lo veo bien ¿que puede ser? gracias de antemano.

mi código:

         public object CrearPedido()

         {

             PedidosWebRef.OrdersService ServicioPedido = new PedidosWebRef.OrdersService();

             string Session1 = Session["IDSeccion"].ToString();

             MsgHeader msgHeader = new MsgHeader();

             msgHeader.SessionID = Session1;

             ServicioPedido.MsgHeaderValue = msgHeader;

             PedidosWebRef.Document CrearPedido = new PedidosWebRef.Document();

             CrearPedido.CardCode = "CN16504364";

             CrearPedido.CardName = "BETANCOURT OSORIO WILMER";

             CrearPedido.NumAtCard = "JUANTEST";

            

             CrearPedido.DocDueDate = DateTime.Now;

             CrearPedido.DocDueDateSpecified = true;

             CrearPedido.DocDate = DateTime.Now;

             CrearPedido.DocDateSpecified = true;

             CrearPedido.TaxDate = DateTime.Now;

             CrearPedido.TaxDateSpecified = true;

             CrearPedido.SalesPersonCode = 27;

             CrearPedido.SalesPersonCodeSpecified = true;

             PedidosWebRef.DocumentDocumentLine dline = new PedidosWebRef.DocumentDocumentLine();

             dline.WarehouseCode = "R601";

             dline.ItemCode = "0257101321";

             dline.ItemDescription = "205/60R-13 XR611 NANKANG";

             dline.Quantity = 2;

             dline.QuantitySpecified = true;

             dline.UnitPrice = 10;

             dline.UnitPriceSpecified = true;

             dline.TaxCode = "IVAG01";

           

             CrearPedido.DocumentLines = new DocumentDocumentLine[] { dline };

         

                 ServicioPedido.Add(CrearPedido);

              

            

             return true;

          

         }

Accepted Solutions (1)

Accepted Solutions (1)

maik_delly
Active Contributor
0 Kudos

Hola Juan,

lo siento, mi español no es lo suficientemente bueno..( and this is an english speaking forum )


You are missing the servicename definition in header level - this should do the trick :


MsgHeader msgHeader = new MsgHeader();

msgHeader.SessionID = Session1;

msgHeader.ServiceName = ServicioPedido.MsgHeaderServiceName.OrdersService;

msgHeader.ServiceNameSpecified = true;

ServicioPedido.MsgHeaderValue = msgHeader;



regards,

Maik

juandfranco
Explorer
0 Kudos

Thanks, Maik this correct, but for reasons of compatibility decided move mi app to only DISERVER,¿How compactible is b1ws in sap 9.1 ?

maik_delly
Active Contributor
0 Kudos

Hi Juan,

B1WS is compatible - but maybe you have to make little adjustments in source code ( to support MSSQL 2014 - you find info in this forum  ), and you should generate new WSDLs.

Basically DI Server is a SOAP based service for interacting with SBO. B1WS is "simply" generating the corresponding WSDLs and puts the interaction in an IIS context.

regards,

Maik

Answers (0)